#!/bin/bash

# node part

sudo apt-get update

curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install nodejs
ver=$(node -v)
IntentVer="v12.18.4"
if [ $ver!=$IntentVer ]
then
        echo "\e[1;31;43mearly version which may be not so cool has been installed\e[1;37;40m"
fi
#get taobao source
npm config set registry https://registry.npm.taobao.org
npm i -g express

# typescript
if [ $1="-t" ]
    sudo npm install -g typescript
fi
#vue
sudo npm install vue@next -g
#if sudo npm install -g @vue/cli@next

sudo npm install -g @vue/cli@next

if [ $? -eq 0 ]
then
    echo "have installed vue/cli @$(vue -V)"
fi